%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for queries/polymorphic/zero-implementations"
    Bucket0("Bucket 0 (root)<br /><br />1: PgUnionAll[7]<br />2: Connection[8]<br />3: ConnectionItems[9]"):::bucket
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 8, 9<br /><br />ROOT Connectionᐸ7ᐳ[8]"):::bucket
    Bucket3("Bucket 3 (listItem)<br /><br />ROOT __Item{3}ᐸ9ᐳ[12]"):::bucket
    end
    Bucket0 --> Bucket1
    Bucket1 --> Bucket3

    %% plan dependencies
    Connection8[["Connection[8∈0] ➊<br />ᐸ7ᐳ"]]:::plan
    PgUnionAll7[["PgUnionAll[7∈0] ➊"]]:::plan
    PgUnionAll7 --> Connection8
    ConnectionItems9[["ConnectionItems[9∈0] ➊"]]:::plan
    Connection8 --> ConnectionItems9
    __Item12[/"__Item[12∈3]<br />ᐸ9ᐳ"\]:::itemplan
    ConnectionItems9 ==> __Item12

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,PgUnionAll7,Connection8,ConnectionItems9 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1 bucket1
    classDef bucket3 stroke:#ffa500
    class Bucket3,__Item12 bucket3

